/*
 * @Description:
 * @Date: 2023-03-24 16:17:26
 * @LastEditors: czp
 * @LastEditTime: 2023-04-23 09:50:07
 */
import axios from "@/utils/axios";
import { ISignUpForm } from "@/components/ToolRight/components/SignUp.vue";
import { IDictI, IUploadSignResp } from "../interface/base";
import { IShareData } from "@/hook/useWxSdk";

/**
 * 获取验证码
 */
export const baseGetValidateCode = (options: Pick<ISignUpForm, "way" | "target" | "callAreaCode">) => {
	return axios.request<null>({
		url: "api/front/validateCode/send",
		method: "POST",
		data: options
	});
};

/**
 * 获取文件上传签名
 */
export const baseGetUploadSign = () => {
	return axios.request<IUploadSignResp>({
		url: "api/front/index/getUploadTmpSecret",
		method: "POST"
	});
};

/**
 * 获取国籍列表
 */
export const baseCountryList = () => {
	return axios.request<IDictI[]>({
		url: "api/front/country/getList",
		method: "POST"
	});
};

/**
 * 获取民族列表
 */
export const baseNationList = () => {
	return axios.request<IDictI[]>({
		url: "api/front/nation/getList",
		method: "POST"
	});
};
/**
 * 获取分享信息
 * @param options
 * @returns
 */
export const baseGetShare = (options: { url: string }) => {
	return axios.request<IShareData>({
		url: "api/front/share/getShare",
		method: "POST",
		data: options
	});
};
